const mongoose = require("mongoose");
const { mongopath } = require("../config/config.default");
const main = async () => {
  await mongoose.connect(mongopath);
};

main()
  .then((res) => {
    console.log("mongodb连接成功~");
  })
  .catch((err) => {
    console.log("mongodb连接失败~");
  });

module.exports = {
  User: mongoose.model("User", require("./userModel")), //定义用户模型
};
